package yyds.sniarbtej;

import java.util.ArrayList;
import java.util.List;

public class AppUtils {

    private AppUtils() {
    }

    public static void showUsage() {
        Agent.printVersionInfo();
        System.out.println("Generate License Key: java -jar sniarbtej.jar -genkey [-id=<licenseId>] [-user=<username>] [-exp=<expireDate>] [-products=<products>]");
        System.out.println("    licenseId(id) default is SNIARBTEJ");
        System.out.println("    username(user) default is \"JetBrains YYDS\"");
        System.out.println("    expireDate(exp) format: yyyy-MM-dd, default is 2048-10-24");
        System.out.println("    products format: II");
        System.out.println("    products format: II,CL");
        System.out.println("    products default is: all known available products (-list view)");
        System.out.println();
        System.out.println("List Known Available Products: java -jar sniarbtej.jar -list");
        System.out.println();
    }

    public static void showAvailableProducts() {
        System.out.println("Know Available Products:");
        List<String> products = new ArrayList<>();

        for (String[] product : LicenseGenerator.productMatrix) {
            System.out.printf("%-80s : %s%n", product[0], product[1]);
            products.add(product[1]);
        }

        System.out.println();
        System.out.println(String.join(",", products));
    }
}
